-
Notifications
You must be signed in to change notification settings - Fork 62
Fix handle stop partition request #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
handle unexpected message for topic reader
|
|
||
|
|
||
| class UnexpectedGrpcMessage(Error): | ||
| def __init__(self, message: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
useless __init__
| _buffer_size_bytes: int # use for init request, then for debug purposes only | ||
| _decode_executor: concurrent.futures.Executor | ||
| _decoders: Dict[int, typing.Callable[[bytes], bytes]] # dict[codec_code] func(encoded_bytes)->decoded_bytes | ||
| _logger: logging.Logger |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is this internal logger for? I think this is strange and complicating.
| def set_logged(*args, **kwargs): | ||
| logged.set() | ||
|
|
||
| stream_reader._logger = mock.Mock() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are more beautiful and simple way to check log in pytest.
looks at https://docs.pytest.org/en/7.1.x/how-to/logging.html#caplog-fixture
I hereby agree to the terms of the CLA available at: https://yandex.ru/legal/cla/?lang=en
Pull request type
Please check the type of change your PR introduces:
What is the current behavior?
Raise unimplemented exception for stop partition request
What is the new behavior?
Hanlde stop partition request
Close #297